import { create } from 'zustand';
import { fabric } from 'fabric';

interface ImageState {
  images: fabric.Image[];
  addImage: (image: fabric.Image) => void;
  removeImage: (image: fabric.Image) => void;
  clearImages: () => void;
}

export const useImageStore = create<ImageState>((set) => ({
  images: [],
  addImage: (image) => set((state) => ({ images: [...state.images, image] })),
  removeImage: (image) =>
    set((state) => ({
      images: state.images.filter((img) => img !== image),
    })),
  clearImages: () => set({ images: [] }),
})); 